cmake_minimum_required(VERSION 2.8)

message("-- Project: uibase")

file(GLOB uibase_src 
	"${PROJECT_SOURCE_DIR}/uibase/*.cpp")

file(GLOB uibase_uilib_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/*.cpp")

file(GLOB uibase_uilib_control_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/control/*.cpp")

file(GLOB uibase_uilib_core_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/core/*.cpp")

file(GLOB uibase_uilib_layout_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/layout/*.cpp")

file(GLOB uibase_uilib_util_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/utils/*.cpp")

file(GLOB uibase_uilib_util_c_src 
	"${PROJECT_SOURCE_DIR}/uibase/uilib/utils/*.c")
	
add_library(uibase SHARED ${uibase_src}
			${uibase_uilib_src}
			${uibase_uilib_control_src}
			${uibase_uilib_core_src}
			${uibase_uilib_layout_src}
			${uibase_uilib_util_src}
			${uibase_uilib_util_c_src})
set_target_properties(uibase PROPERTIES OUTPUT_NAME "uibase")
target_link_libraries(uibase stdcrt)

include_directories(
	${PROJECT_SOURCE_DIR}/include
	${PROJECT_SOURCE_DIR}/crt
	${PROJECT_SOURCE_DIR}/extensions/include
	${by3rd_library_include})

if (${WIN_OS})

	target_link_libraries(uibase winmm)
	target_link_libraries(uibase comctl32)
	target_link_libraries(uibase stdcrt)
	target_link_libraries(uibase shlwapi)

	set(CMAKE_SHARED_LINKER_FLAGS 
		"${CMAKE_SHARED_LINKER_FLAGS} /DEF:${PROJECT_SOURCE_DIR}/uibase/dllexports.def")
else()

	include_directories(
		/usr/local/include
		/opt/include
		/usr/include)

	set_target_properties(uibase PROPERTIES COMPILE_FLAGS ${dynamic})
	set_target_properties(uibase PROPERTIES COMPILE_FLAGS ${compile})
	set_target_properties(uibase PROPERTIES LINK_FLAGS ${r_path})

	if(${LINUX_OS})
		target_link_libraries(uibase dl)
	endif()

	if(${UNIX_OS})
		target_link_libraries(uibase)
	endif()



endif()


